package com.example.tx.service;

import com.example.tx.domain.TxTest;
import com.example.tx.mapper.TxTestMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>  </p>
 *
 * @author Chris
 * @since 2022/11/29 20:28
 */
@Service
public class TxTestServiceImpl implements TxTestService {

    private final TxTestMapper txTestMapper;

    public TxTestServiceImpl(TxTestMapper txTestMapper) {
        this.txTestMapper = txTestMapper;
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public void save(TxTest txTest) {
        txTestMapper.save(txTest);
    }

}